package cn.enjoy.design.behavior.observe.listener;

import cn.enjoy.design.behavior.observe.event.Event;
import cn.enjoy.design.behavior.observe.event.EventType;
import cn.enjoy.design.behavior.observe.event.FinishEvent;
import cn.enjoy.design.behavior.observe.event.SubmitEvent;
import lombok.extern.slf4j.Slf4j;

/**
 * @author K
 * @date 2021/11/17 14:35
 */
@Slf4j
public class SystemLogListener implements Listener<Event> {
    @Override
    public EventType getEventType() {
        return EventType.SYSTEM_ORDER;
    }

    @Override
    public void handle(Event event) {
        if (getEventType().equals(event.getEventType())) {
            if (event instanceof SubmitEvent) {
                log.info("新增日志-创建系统工单");
            } else if (event instanceof FinishEvent) {
                log.info("新增日志-完成系统工单");
            }
        }
    }

}
